home *** CD-ROM | disk | FTP | other *** search
- Path: unixg.ubc.ca!news
- From: jamesdf@unixg.ubc.ca (James Fairweather)
- Newsgroups: comp.lang.c++
- Subject: Re: friend functions and access to private variables...
- Date: Fri, 08 Mar 1996 05:36:48 GMT
- Organization: Resnet
- Message-ID: <4hogra$gnn@nntp.ucs.ubc.ca>
- References: <4ho95g$hjq@ccshst05.cs.uoguelph.ca>
- NNTP-Posting-Host: srtb0411a01.resnet.ubc.ca
- X-Newsreader: Forte Free Agent 1.0.82
-
- >I'm dealing with two classes, where a member function of class A is declared as
- >a friend function of class B.
-
- >Unfortunately this does not allow the friend function access to private variables in
- >class B...what gives? Is it not legal to make such a declaration?
-
- Heh, you have it backwards. To allow class A to access B's private
- members, put friend class _A_; in B's header.
-
- James
-
-